import 'package:enterprise_v6_app/app/components/custom_modele/custom_card.dart';
import 'package:enterprise_v6_app/app/components/custom_modele/custom_row_title.dart';
import 'package:enterprise_v6_app/app/modules/task/task_all/education/me_demand_research/me_demand_research_detail/foundation_info/foundation_info_controller.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

///基础信息
class FoundationInfoPage extends StatelessWidget {
  FoundationInfoPage({super.key});

  final controller = Get.put(FoundationInfoController());

  @override
  Widget build(BuildContext context) {
    return GetBuilder(
        init: controller,
        builder: (_) {
          return Container(
            padding: EdgeInsets.only(left: 16.w, top: 14.w, right: 16.w, bottom: 14.w),
            child: CustomCard(
              content: Column(
                children: [
                  CustomRowTitle(
                    title: '调研名字：',
                    content: controller.data?.surveyName ?? '',
                  ),
                  CustomRowTitle(
                    title: '发起部门：',
                    content: controller.data?.launchDepartmentName ?? '',
                  ),
                  CustomRowTitle(
                    title: '调研对象：',
                    content: controller.data?.surveyUsers?.map((e) => e.surveyUserName).toList().toString().replaceAll(']', '').replaceAll('[', ''),
                  ),
                  Get.arguments['isText'] as bool
                      ? Container()
                      : CustomRowTitle(
                          title: '调研问题：',
                          content: controller.data?.questions?.map((e) => e.questionMain).toList().toString().replaceAll(']', '').replaceAll('[', ''),
                        ),
                  CustomRowTitle(
                    title: '调研截止时间：',
                    content: controller.data?.surveyDateEnd ?? '',
                  ),
                ],
              ),
            ),
          );
        });
  }
}
